package com.eight.cloud.client.config;

import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 请求配置
 *
 * @ClassName: RequestConfig
 * @Author: TXC
 * @Date: 2024-11-25 16:23
 **/

@Getter
@Configuration
@ConfigurationProperties(prefix = "eight.public.platform.openapi")
public class RequestConfig {
    private final String secretId;
    private final String secretKey;
    private final String serverUrl;
    private final String serverWsUrl;

    public RequestConfig(String secretId, String secretKey, String url, String serverWsUrl) {
        this.secretId = secretId;
        this.secretKey = secretKey;
        this.serverUrl = url;
        this.serverWsUrl = serverWsUrl;
    }


    public static class Builder {
        private String secretId;
        private String secretKey;
        private String url;
        private String serverWsUrl;
        public Builder setSecretId(String secretId) {
            this.secretId = secretId;
            return this;
        }

        public Builder setSecretKey(String secretKey) {
            this.secretKey = secretKey;
            return this;
        }

        public Builder setUrl(String url) {
            this.url = url;
            return this;
        }

        public Builder setServerWsUrl(String serverWsUrl) {
            this.serverWsUrl = serverWsUrl;
            return this;
        }

        public RequestConfig build() {
            return new RequestConfig(secretId, secretKey, url, serverWsUrl);
        }
    }
}
